package two.chapter_3.c3_5;

import two.chapter_3.c3_4.LinearProbingHashST;

import java.util.Iterator;

public class HashSet<Key> implements Set<Key> {
    private LinearProbingHashST<Key,String> st;
    private static final String DEFAULT_VALUE="set";

    public HashSet(){
        st=new LinearProbingHashST<>();
    }
    @Override
    public void add(Key key) {
        st.put(key,DEFAULT_VALUE);
    }

    @Override
    public void delete(Key key) {
        st.delete(key);
    }

    @Override
    public boolean contains(Key key) {
        return st.contains(key);
    }

    @Override
    public boolean isEmpty() {
        return st.isEmpty();
    }

    @Override
    public int size() {
        return st.size();
    }
    public Iterable<Key> keys() {
        return st.keys();
    }
    @Override
    public Iterator<Key> iterator() {
        return st.keys().iterator();
    }



}
